{% load adminmedia %}
{% load i18n %}
{% if cl.search_fields %}
	<form id="changelist-search" action="" method="get" class="widget-search-form">
		<div class="input-append"><!-- DIV needed for valid HTML -->
			<input type="text" id="searchbar" name="{{ search_var }}" value="{{ cl.query }}" class="input-xlarge" placeholder="{% trans 'Search' %}">
			<button type="submit" class="btn"><i class="icon-search"></i>&nbsp;</button>
			{% if show_result_count %}
			    <span class="badge">{% blocktrans count cl.result_count as counter %}{{ counter }} result{% plural %} {{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}pop=1{% endif %}">{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a>)</span>
			{% endif %}
			{% for pair in cl.params.items %}
			    {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endifnotequal %}
			{% endfor %}
		</div>
	</form>
	<script type="text/javascript">document.getElementById("searchbar").focus();</script>
{% endif %}
